Observable

open class Observable : ObservableInterface

The `observable` interface provides basic Publish&Subscribe functionality. Classes that extend this functionality and capable of generating events, have to specify event types and corresponding data format for an event.

Functions

subscribe
Link copied to clipboard
open fun subscribe(@NonNull() observer: Observer, @NonNull() events: List<String>)
Subscribes an `observer` to a provided array of event types.The `observable` will hold a strong reference to an `observer` instance, therefore,in order to stop receiving notifications, caller must call `unsubscribe` with an`observer` instance used for an initial subscription.
unsubscribe
Link copied to clipboard
open fun unsubscribe(@NonNull() observer: Observer)
Unsubscribes an `observer` from all events.
open fun unsubscribe(@NonNull() observer: Observer, @NonNull() events: List<String>)
Unsubscribes an `observer` from a provided array of event types.

Inheritors

StyleManager
Link copied to clipboard